package com.j283_5.wisdom_park.controller.bill_management;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.j283_5.wisdom_park.common.result.ResultData;
import com.j283_5.wisdom_park.pojo.Announcement;
import com.j283_5.wisdom_park.pojo.Visitors;
import com.j283_5.wisdom_park.service.TenantbillsService;
import com.j283_5.wisdom_park.vo.bill_management.TenantbillsVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 *  租户账单管理
 * </p>
 *
 * @author laoda
 * @since 2022-04-28
 */
@RestController
@RequestMapping("/tenantbills")
@Api(value = "车辆账单管理",tags = "车辆账单管理",produces="冯弋舟")
public class TenantbillsController {

    @Resource
    private TenantbillsService service;

    /**
     * 多条件查询租户账单
     * @return
     */
    @RequestMapping(value = "/findTenantbills" , method = RequestMethod.GET)
    @ApiOperation(value = "多条件查询租户账单",notes = "多条件查询租户账单（分页）",produces="冯弋舟", response = ResultData.class)
    public ResultData findTenantbills(@Param("page") Page<Visitors> page, @Param("tenantbillsVo")TenantbillsVo tenantbillsVo){
        List<TenantbillsVo> list=new ArrayList<>();
        TenantbillsVo tenantbillsVo1=new TenantbillsVo(1,"杭州久碳科技有限公司","SF-2021-07-14-00008","电费",443,0.53,new Timestamp(System.currentTimeMillis()),
                new Timestamp(System.currentTimeMillis()),"src/main/resources/img",0,"张晓萌","13165165","A1",101);
        list.add(tenantbillsVo1);
        return ResultData.ok().data(list);
    }

    /**
     * 查询租户详情
     * @return
     */
    @RequestMapping(value = "/findTenantbillsInfo" , method = RequestMethod.POST)
    @ApiOperation(value = "查询租户详情",notes = "查询租户详情",produces="冯弋舟", response = ResultData.class)
    public ResultData findTenantbillsInfo(@Param("tenId")Integer  tenId){
        List<TenantbillsVo> list=new ArrayList<>();
        TenantbillsVo tenantbillsVo1=new TenantbillsVo(1,"杭州久碳科技有限公司","SF-2021-07-14-00008","电费",443,0.53,new Timestamp(System.currentTimeMillis()),
                new Timestamp(System.currentTimeMillis()),"src/main/resources/img",0,"张晓萌","13165165","A1",101);
        list.add(tenantbillsVo1);
        return ResultData.ok().data(list);
    }

    /**
     * 新增租户详情
     * @return
     */
    @RequestMapping(value = "/insertTenantbillsInfo" , method = RequestMethod.GET)
    @ApiOperation(value = "新增租户详情",notes = "新增租户详情",produces="冯弋舟", response = ResultData.class)
    public ResultData insertTenantbillsInfo(@Param("tenantbillsVo")TenantbillsVo tenantbillsVo){
        List<TenantbillsVo> list=new ArrayList<>();
        TenantbillsVo tenantbillsVo1=new TenantbillsVo(1,"杭州久碳科技有限公司","SF-2021-07-14-00008","电费",443,0.53,new Timestamp(System.currentTimeMillis()),
                new Timestamp(System.currentTimeMillis()),"src/main/resources/img",0,"张晓萌","13165165","A1",101);
        list.add(tenantbillsVo1);
        return ResultData.ok().data(list);
    }

    /**
     * 删除租户详情
     * @return
     */
    @RequestMapping(value = "/deleteTenantbillsInfo" , method = RequestMethod.POST)
    @ApiOperation(value = "删除租户详情",notes = "删除租户详情",produces="冯弋舟", response = ResultData.class)
    public ResultData deleteTenantbillsInfo(@Param("tenId")Integer  tenId){

        return ResultData.ok();
    }
}

